From ea46f4288682b895c48bc37b9c81c588c7b94cc8 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Fri, 2 Jan 2009 00:11:48 +0000 Subject: [PATCH] Don't use for (i in array) in JavaScript This reportedly can cause errors, because it will return all object attributes, not just array elements. Use a C-style for here instead. This could be done in other places too -- the immediate motive here is that this might be related: http://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#Sortable_tables_.26_Firefox_3.0.5 The functionality seems to still work. --- skins/common/wikibits.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js index 3421aeec20..089d22d76b 100644 --- a/skins/common/wikibits.js +++ b/skins/common/wikibits.js @@ -661,7 +661,7 @@ function ts_resortTable(lnk) { span.setAttribute('sortdir','down'); } - for(var i in staticRows) { + for (var i = 0; i < staticRows.length; i++) { var row = staticRows[i]; newRows.splice(row[2], 0, row); } -- 2.20.1